<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue使用之计算属性</title>
    <script src="../vue.min.js" type="text/javascript"></script>
</head>
<body>
<div id="app">
    {{reverseMsg()}}
    {{reverseMsg()}}
    {{reverseMsg()}}
</div>

<script type="text/javascript">
    var app=new Vue({
        el: '#app',
        data:{
            //message:'hello'
            message:`<div>hello hyq</div>`

        },
        methods: {
            reverseMsg:function () {
                console.log('methods');
                return this.message.split('').reverse().join('-')
            }
        }
        // computed: {
        //     reverseMsg:function () {
        //         console.log('computed');
        //         return this.message.split('').reverse().join('-')
        //     }
        // }
    })
</script>
</body>
</html>